class Downfile < ActiveRecord::Base
   belongs_to :download
   has_attachment  :storage => :file_system,
                 :min_size => 0.kilobytes,
                 :max_size => 10.megabytes,
                 :content_type => ['application/pdf', 'application/msword','application/rar','application/zip'],
                 :path_prefix => 'public/download' 
    validates_as_attachment

    
    def  full_filename(thumbnail = nil)      
        file_system_path = (thumbnail ? thumbnail_class : self).attachment_options[:path_prefix]      
         File.join(RAILS_ROOT, file_system_path, 'files', thumbnail_name_for(thumbnail))      
    end 
    
end
